package com.rrjjg.app.admin.data.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rrjjg.app.admin.data.service.IPlatformService;
import com.rrjjg.app.admin.data.storage.entity.Platform;
import com.rrjjg.app.admin.data.storage.mapper.PlatformMapper;
import com.rrjjg.app.mybatis.util.PageUtil;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 * 平台 服务实现类
 * </p>
 *
 * @author vayne
 * @since 2023-04-06
 */
@Service
public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform> implements IPlatformService {


    @Override
    public Page<Platform> queryPage(Platform platform, int page, int size) {
        return  page(new Page<>(page,size),PageUtil.queryWrapper(platform,Platform.class));
    }

    @Override
    public List<Platform> getPlatform() {
        LambdaQueryWrapper<Platform> eq = Wrappers.<Platform>lambdaQuery().eq(Platform::getPid, 0L );
        return list(eq);
    }


}
